<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>
      <button>1</button>
      <button>2</button>
      <button>3</button>
      <button>4</button
      ><button>5</button>
      <button>6</button>
      <button>7</button>
      <button>9</button
      ><button>10</button>
      <button>11</button>
    </div>
    <script>
           let  buttons = document.querySelectorAll("button");
           let  div = document.querySelector("div");
           div.addEventListener("click",function(e){
                console.log(e.target);
                buttons = Array.prototype.slice.call(buttons);
               let index = buttons.indexOf(e.target)
               console.log(index+1)
           },true)
    </script>
  </body>
</html>
